Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
Fill down formula using a "dictionary" for sheet and column values in Google Apps Script?

I'm looking to do a filldown formula in Google Apps Script. I have a "dictionary" that contains the sheet names and the columns that need to be filled. However I am running into an issue in that I can't get the sheet I need from my key value. The key returns the right string for the sheet name, but .getsheetbyname(key) "can't read property of null".

Here is what I have:

 function filldown(){
    var sheetNames = {
        "PO Tool Import":["A","AK","AL"],
        "Live Orders Aggregated":["A"],
        "Date Lookup":["A"],
        "Containerized POs":["A","B","C","D","E","F","K","R","S","T","U","V","W","X","Y","Z","AA","AB","AC","AD","AE","AF","AG","AH","AI","AJ","AK","AL","AM","AN","AO","AP","AQ","AR","AS","AT"],
        }

for (var key in sheetNames){

    var sheetName = thisBook.getSheetByName(key).getSheetName();

    Logger.log(key);
    Logger.log(sheetNames[key]);
    Logger.log(sheetName);
    };
};

Using these returns, I will then create a formula to return the index for the columns and the length of the filldown/copy to range.

Any suggestions are appreciated.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Ok so after some review it turns out that the key was not the correct string to match the sheet names, as someone had change the names of the sheets in the workbook.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!